package Haff;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2024-06-05
 * Time: 14:42
 */
public class Node {
        private Character ch;
        private Integer value;
        private Node leftChild;
        private Node rightChild;
        private String code = "";

        public Node(Character ch, Integer value) {
            this.ch = ch;
            this.value = value;
        }

        public Node(Integer value, Node leftChild, Node rightChild) {
            this.value = value;
            this.leftChild = leftChild;
            this.rightChild = rightChild;
        }

        public Character getCh() {
            return ch;
        }

        public void setCh(Character ch) {
            this.ch = ch;
        }

        public Integer getValue() {
            return value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }

        public Node getLeftChild() {
            return leftChild;
        }

        public void setLeftChild(Node leftChild) {
            this.leftChild = leftChild;
        }

        public Node getRightChild() {
            return rightChild;
        }

        public void setRightChild(Node rightChild) {
            this.rightChild = rightChild;
        }

        public String toString(){
            return "Node{" +
                    "ch=" + ch +
                    ", value=" + value +
                    ", leftChild=" + leftChild +
                    ", rightChild=" + rightChild +
                    '}';
        }
    }


